import os
import django

# 设置Django环境
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'community_project.settings')
django.setup()

from core.models import User

print("=== 检查用户数据 ===")

# 检查所有用户
users = User.objects.all()
print(f"总用户数量: {users.count()}")

for user in users:
    print(f"用户ID: {user.user_id}")
    print(f"用户名: {user.username}")
    print(f"账号: {user.account}")
    print(f"昵称: {user.nickname}")
    print(f"创建时间: {user.created_at}")
    print("-" * 50)

# 检查是否有admin相关的用户
admin_users = User.objects.filter(account__icontains='admin')
print(f"\nAdmin相关用户数量: {admin_users.count()}")

for user in admin_users:
    print(f"Admin用户: {user.account} - {user.username}")